<template>
  <view class="content">
    <view class="content1">
      <!-- 币种 -->
      <view class="left">{{ _t18('recharge_coin') }}</view>
      <view class="right">{{ props.data.type }}</view>
    </view>
<!--    <view class="content2">-->
      <!-- 状态 -->
<!--      <view class="left">{{ // _t18('recharge_status') }}</view>-->
<!--      <view class="right">-->
<!--        &lt;!&ndash; 审核中 成功 失败 &ndash;&gt;-->
<!--        <p class="status0" v-if="props.data.status == 0">{{ _t18('recharge_waiting') }}</p>-->
<!--        <p class="status1" v-if="props.data.status == 1">{{ _t18('recharge_tab_success') }}</p>-->
<!--        <p class="status2" v-if="props.data.status == 2">{{ _t18('recharge_tab_error') }}</p>-->
<!--      </view>-->
<!--    </view>-->
    <view class="content4">
      <!-- 充值地址  提现地址 -->
      <view class="top" v-if="$route.path.includes('recharge')">
        {{ _t18('recharge_address', ['bitmake']) }}
      </view>
      <view class="top" v-if="$route.path.includes('withdraw')">{{ _t18('withdraw_address') }}</view>
      <view class="bottom" v-if="$route.path.includes('recharge')">
        <Copy :data="`${props.data.address}`">
          <template #copyMsg>
            <span class="fw-num">{{ props.data.address }}</span>
          </template>
        </Copy>
      </view>
      <view class="bottom" v-if="$route.path.includes('withdraw')">
        <Copy :data="`${props.data.toAdress}`">
          <template #copyMsg>
            <span class="fw-num">{{ props.data.toAdress }}</span>
          </template>
        </Copy>
      </view>
    </view>
    <view class="content3">
      <!-- 时间 -->
      <view class="left">数量</view>
      <view class="right ff-num">{{ props.data.realAmount }} USDT</view>
    </view>
    <view class="content3">
      <!-- 时间 -->
      <view class="left">网络手续费</view>
      <view class="right ff-num">0.00000000</view>
    </view>
    <view class="content3">
      <!-- 时间 -->
      <view class="left">钱包</view>
      <view class="right ff-num">平台资产</view>
    </view>
    <view class="content3">
      <!-- 时间 -->
      <view class="left">日期</view>
      <view class="right ff-num">{{ _timeFormat(props.data.params.createTime) }}</view>
    </view>

    <view class="content5" v-if="$route.path.includes('recharge')">
      <!-- 订单号 -->
      <view class="top">{{ _t18('orderCode') }}</view>
      <view class="bottom">
        <Copy :data="`${props.data.serialId}`">
          <template #copyMsg>
            <span class="fw-num">{{ props.data.serialId }}</span>
          </template>
        </Copy>
      </view>
    </view>

    <view style="    background: rgb(235, 236, 240);
    padding: 15px 35px;
    display: inline-block;
    border-radius: 8px;" @click="copyText">
      保存地址
    </view>

  </view>
</template>
<script setup>
import { _toView, _hideAddress, _t18 } from '@/utils/public'
import Copy from '@/components/common/Copy/index.vue'
const props = defineProps({
  data: {
    type: Object
  }
})
const copyText = () => {
  const text = props.data.toAdress
  const textarea = document.createElement('textarea');
  textarea.value = props.data.toAdress;
  document.body.appendChild(textarea);
  textarea.select();
  document.execCommand('Copy');
  document.body.removeChild(textarea);
  alert('已复制到剪贴板！');
}

</script>

<style lang="scss" scoped>
.content {
  padding: 20px 15px;
  & > div {
    .left,
    .top {
      color: var(--ex-passive-font-color);
    }
  }

  .content1,
  .content2,
  .content3 {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-content: center;
    .top {
      margin-bottom: 10px;
    }
    .right {
      .status0 {
        color: var(--ex-font-color23);
      }
      .status1 {
        color: var(--ex-font-color9);
      }
      .status2 {
        color:var(--ex-font-color3);
      }
    }
  }
  .content4,
  .content5 {
    margin-bottom: 15px;
    .bottom {
      font-weight: 500;
    }
  }
}
</style>

